<div class="loading-container"><div class="loader"></div></div>

<div class="wrapper wrapper-shadow wrapper-list"> 
	<!-- list data wrapper -->
	<div class="result-wrapper no-padding">
   	<div class="result-body">
   		<div class="tabs">
      	<ul class="nav nav-tabs widget no-margin-bottom">
        	<li class="active"> 
         		<a href="#tab-content" data-toggle="tab"> 
         			<span class="menu-icon"><i class="fa fa-user-plus"></i></span> 数据字典
           	</a>
         	</li>
        </ul>
        <div class="tab-content no-border xs-padding">
					<div class="tab-pane active" id="tab-content">
           	<div id="toolbar" class="btn-group">
					    <button type="button" class="btn btn-success" onclick="handlerCreate(this);"  data-editor-path="/miwawa/content/system/codec/editor/" data-editor-page="add.html">
			        	<i class="fa fa-plus"></i> 新增
					    </button>
						</div>
           	<table data-ajax="handlerSearch" 
       					 	 data-method="post" 
       					 	 data-search="true" 
       					 	 data-toolbar="#toolbar" 
       					 	 data-id-field="id" 
       					 	 data-unique-id="id" 
       					 	 data-pagination="true" 
       					 	 data-show-toggle="true" 
       					 	 data-show-refresh="true" 
       					 	 data-show-columns="true" 
       					 	 data-check-on-init="true" 
       					 	 data-click-to-select="true" 
       					 	 data-side-pagination="server" 
       					 	 data-mobile-responsive="true" 
           				 data-event-onload="handlerSuccess" 
       					 	 data-form-search="#search-form-codec" id="table-codec" class="bootstrap-table">
							<thead>
								<tr>
									<th data-checkbox="true"></th>
									<th data-field="id" 				data-visible="false" data-switchable="false">ID</th>
									<th data-field="name" 			data-align="center" >字典名称</th>
									<th data-field="code" 			data-align="center" data-editable="true">字典编码</th>
									<th data-field="sort" 			data-align="center" >排序号</th>
									<th data-field="operator" 	data-align="center" data-width="65" data-formatter="renderOperator" data-table-target="codec">操作</th>
								</tr>
							</thead>
						</table>
        	</div>
      	</div>
    	</div>
   	</div>
	</div>

	<!-- form editor wrapper -->
	<div class="editor-wrapper">
		
	</div>
</div>
<!-- PAGE CONTENT END =============================================== -->

<!-- 查询表单 ========================================================= -->
<form id="search-form-codec" action="/miwawa/default/common/search.json" method="post" 
			name="com.app.miwawa.api.system.entity.config.Codec">
			<input type="hidden" name="pcode" value="system" data-search-group="and" data-search-operation="EQ">
			<input type="hidden" name="status" value="0" 		 data-search-group="and" data-search-operation="EQ">
			<input type="hidden" name="invalid" value="F" 	 data-search-group="and" data-search-operation="EQ">
</form>

<!-- 删除表单 ========================================================= -->
<form id="remove-form-codec" action="/miwawa/default/common/remove" method="post" name="com.app.miwawa.api.system.entity.config.Codec"></form>
			
<!-- Javascript ===================================================== -->
<script src="/miwawa/resources/lib/miwawa/1.0.2/js/core/requirejs/require.js"></script>

<script type="text/javascript">
<!--
	jQuery(function(){
		require(['/miwawa/resources/lib/miwawa/1.0.2/js/core/module/app/simple.js'], function(simple){
			simple(['registerForm','registerTable','registerWidget']);
		});
	});
	
	function renderOperator(value, row, index){
		jQuery("[data-toggle='tooltip']").tooltip('destroy');
		
		switch(this.tableTarget){
			case "codec":
				return "<a class='btn btn-info 	 btn-xs btn-table-op' onclick='handlerCreate(this,\""+row.id+"\")' 	data-table-source='#table-codec' data-editor-path='/miwawa/content/system/codec/editor' data-editor-page='edit.html' data-toggle='tooltip' data-placement='top' title='查看与编辑'> <i class='ion-compose'></i> </a>"
		 		 		 + "<a class='btn btn-danger btn-xs btn-table-op' onclick='handlerRemove(this, \""+row.id+"\")' data-table-source='#table-codec' data-form-source='#remove-form-codec' data-toggle='tooltip' data-placement='top' title='删除'> <i class='fa fa-trash'></i> </a>";
			case "codesub":
				return row.id == "new" || row.id == "edit" ? value :
						"<a class='btn btn-info	  btn-xs btn-table-op' onclick='handlerEditRow(this, \""+index+"\")' data-table-source='#table-codesub' data-rowdata='"+JSON.stringify(row)+"' data-toggle='tooltip' data-placement='top' title='修改'> <i class='ion-compose'></i> </a>" 
					+ "<a class='btn btn-danger btn-xs btn-table-op' onclick='handlerRemove(this, \""+row.id+"\")' data-table-source='#table-codesub' data-form-source='#remove-form-codec' data-toggle='tooltip' data-placement='top' title='删除'> <i class='fa fa-trash'></i> </a>";
		}
	}
//-->
</script>
